package mythesis.controller;
import java.io.*;
import java.lang.*;

public function write(xml:String, fileNumber:Number):String
{
    try{
	    var fstream:java.io.FileWriter = new FileWriter("CustomAI{fileNumber as Integer}.xml");
	    var out:BufferedWriter = new BufferedWriter(fstream);
	    out.write(xml);
	    out.close();
	    return "Successfully saved as CustomAI{fileNumber as Integer}.xml!";
    }
    catch(e:Exception)
    {
		println(" Error in WriteXML.write(): {e}");
		return "Error in writing to CustomAI{fileNumber as Integer}.xml, please check console output for details.";       
    }
}

public class WriteXML {

};
